/* Layout */
import Layout from '@/layout';


export const staticRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component:() => import('@/layout/index.vue'), // 一级路由在App.vue渲染,
    redirect: '/home',
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index'),
      meta: { title: '首页', icon: 'el-icon-s-home' }
    }]
  },

];

export const allAsyncRoutes = [
  {
    path: "/acl",
    name: "Acl",
    component: () => import("@/layout/index.vue"),
    redirect: "/acl/user/list",
    meta: {
      title: "权限管理",
      icon: "el-icon-setting",
    },
    children: [
      {
        name: "User",
        path: "/acl/user/list",
        component: () => import("@/views/acl/user/index.vue"),
        meta: {
          title: "用户管理",
        },
      },
      {
        name: "Role",
        path: "/acl/role/list",
        component: () => import("@/views/acl/role/index.vue"),
        meta: {
          title: "角色管理",
        },
      },
    ],
  },
  {
    path: '/product',
    name: 'Product',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '商品管理',
      icon: 'el-icon-s-goods',
    },
    children: [
      {
        path: 'trademark/list',
        name: 'Trademark',
        component: () => import('@/views/product/trademark/index.vue'),
        meta: {
          title: '品牌管理'
        }
      },
      {
        path: 'attr/list',
        name: 'Attr',
        component: () => import('@/views/product/attr/index.vue'),
        meta: {
          title: '平台属性管理'
        }
      },

      // {
      //   path: 'spu/list',
      //   name: 'Spu',
      //   component: () => import('@/views/product/spu/index.vue'),
      //   meta: {
      //     title: 'SPU管理'
      //   }
      // },
      // {
      //   path: 'sku/list',
      //   name: 'Sku',
      //   component: () => import('@/views/product/sku/index.vue'),
      //   meta: {
      //     title: 'SKU管理'
      //   }
      // },
    ]
  },

];

export const anyRoute = [
  // 404 page must be placed at the end !!!
  { path: '/:pathMatch(.*)', redirect: '/404', hidden: true }
];